1. Field of the Invention
The present invention relates to an image processing apparatus that processes image data captured by a rolling shutter system, an image processing method, and an image capturing apparatus.
2. Description of the Related Art
Recently, vehicle-mounted cameras have been markedly popularized. Image data, taken by a vehicle-mounted camera while a vehicle is moving, is recorded, and is used as an evidential matter when an accident occurs, or edited for pleasure, for example. A complementary metal-oxide semiconductor (CMOS) image sensor is an example of image capturing elements used for vehicle-mounted cameras. The CMOS image sensor is an X-Y address type, and reads image data by using a rolling shutter.
When a subject is imaged by using an image capturing element having the rolling shutter under illumination by a light source blinking at a predetermined frequency, such as a fluorescent lamp directly lighted by a commercial alternating-current power source, non-uniform luminance occurs in a vertical direction in each frame of image data if the exposure time is made significantly shorter than the emission period of a light source. When a frame rate of imaging and the light emission cycle of the light source are different from each other, non-uniform state of luminance in the vertical direction changes and luminance flicker (so-called fluorescent lamp flicker) occurs in a temporal direction. This is because the rolling shutter, unlike a global shutter, cannot expose all of the pixels with the same timing under illumination if a periodically blinking light source is used.
In Japan, a frequency of a commercial alternating-current power source differs in two areas. Roughly, the frequency is 50 Hz in an area on the east side of the Itoigawa-Shizuoka tectonic line (50 Hz area) while the frequency is 60 Hz in an area on the west side of the Itoigawa-Shizuoka tectonic line (60 Hz area). A vehicle provided with a vehicle-mounted camera using an image capturing element having the rolling shutter may run across a border between the 50 Hz area and the 60 Hz area. In this case, if the vehicle-mounted camera uses a flicker elimination filter that corresponds to either a frequency of 50 Hz or 60 Hz, flicker occurs in image data produced by the vehicle-mounted camera when the vehicle runs in an area of the other frequency.
Japanese Patent Application Laid-open No. 2008-109253 discloses a technique which determines whether a light source is a fluorescent lamp of a non-inverter system when imaging is carried out by using a rolling shutter, and which determines whether the driving frequency of the fluorescent lamp is 50 Hz or 60 Hz if the light source is the fluorescent lamp of a non-inverter system.
In other words, in Japanese Patent Application Laid-open No. 2008-109253, a normal exposure image under 1/60 second exposure and a short time exposure image under 1/240 second exposure are alternately imaged by using the rolling shutter when the frame rate of data acquisition is 60 frames per second (fps), for example. Then, it is detected whether the light source is a fluorescent lamp of a non-inverter system by comparing the luminance distributions in the vertical direction between the normal exposure image and the temporally adjacent short time exposure image. If the light source is the fluorescent lamp of a non-inverter system, it is detected whether the driving frequency of the fluorescent lamp is 50 Hz or 60 Hz by comparing the luminance distributions in the vertical direction between the two short time exposure images that are temporally adjacent to each other.
The method disclosed in Japanese Patent Application Laid-open No. 2008-109253, however, has a problem in that two types of exposure need to be carried out so that the control of the image capturing apparatus becomes complicated. In addition, another problem arises in that a system becomes complex by the need to have a memory that stores the luminance distributions in the vertical direction.